feat(server): @deprecated docblocks on controller methods for deprecated operations - #136
Merged
Merged
Conversation
Contributor
Qodana for PHPIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Detected 12 dependenciesThird-party software listThis page lists the third-party software dependencies used in project
Contact Qodana teamContact us at qodana-support@jetbrains.com
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When an OpenAPI operation is marked
deprecated: true, the generated abstract controller method now carries an@deprecatedline in its PHPDoc. This extends the existing@deprecatedconvention (already emitted on generated Data classes) to the server scaffold, closing one of the ROADMAP "Toward 1.0.0" follow-ups.Changes
OperationDescriptorgains abool $deprecatedproperty (symmetric with the schema-level@deprecatedtag).OperationCollector::describe()sets it from the already-parsedOperationNode::$deprecated(no parser change needed; the reader already surfaced operation-leveldeprecated).ControllerGenerator::renderMethod()emits a plain@deprecatedline (OpenAPI's operationdeprecatedis a bare boolean, so no reason text, matching the Data-class side), composing cleanly with the existing::fromQuery/::fromRoute/::fromHeadersdocblock pointers.DeprecatedOperationTestproves a deprecated operation yields the docblock and a non-deprecated one does not.Output-shape change (rebaseline)
This shifts generated output for 22 corpus specs that contain deprecated operations (github, stripe, openai, jira, zoom, ...). Rebaselined via the project's intentional-rebaseline mechanism: a documented
READER_BASELINE_REBASELINED_DEPRECATED_CONTROLLER_DOCBLOCKSconstant pins exactly those 22 specs, and only their hashes are refreshed (22 insertions / 22 deletions, format preserved). The 5 post-freeze OpenAPI 3.2 specs are untouched. The petstore example, writable drift fixture, and ServerScaffold snapshot use specs with no deprecated operations, so none changed.Gates (local, all green)
composer test 2185 passed / 5 skipped, test:type 100%, stan clean, Pint clean, deptrac 0.